]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
main: Raise the NOFILE limit if a Wayland compositor
authorOlivier Fourdan <ofourdan@redhat.com>
Wed, 19 Jan 2022 09:24:34 +0000 (10:24 +0100)
committerOlivier Fourdan <ofourdan@redhat.com>
Tue, 8 Feb 2022 08:25:25 +0000 (08:25 +0000)
When being run as a Wayland compositor, raise the NOFILE limit to
mitigate the risk of running out of file descriptors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2117>

src/main.c

index 3cd9e10a5bbb920a2b6361780837e49d49204c81..03708fc8fe20684e6ee2d35efe02711ee3273711 100644 (file)
@@ -554,6 +554,9 @@ main (int argc, char **argv)
 
   shell_profiler_init ();
 
+  if (meta_context_get_compositor_type (context) == META_COMPOSITOR_TYPE_WAYLAND)
+    meta_context_raise_rlimit_nofile (context, NULL);
+
   if (!meta_context_start (context, &error))
     {
       g_printerr ("GNOME Shell failed to start: %s", error->message);